#ifndef LOGINIT_H
#define LOGINIT_H

#include <QObject>
#include "QsLog.h"
#include "QsLogDest.h"
#include "QsLogLevel.h"
class LogInit : public QObject
{
    Q_OBJECT
public:
    static LogInit * getInstance(){
        return logInit;
    }

    /**
     * @brief 初始化日志系统
     * @param logLevel 最低日志等级
     * @param filename 日志文件名
     * @param maxByte 最大日志大小
     * @param maxOldFile 存储多少个历史日志
     */
    void init(QsLogging::Level logLevel = QsLogging::DebugLevel,QString filename ="log.txt",int maxByte = 1024*50,uint8_t maxOldFile = 3);

    void setLogLevel(uint8_t level);
signals:

public slots:

private:
    LogInit(QObject *parent = nullptr);

private:
    static LogInit * logInit;
};

#endif // LOGINIT_H
